/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedBeans;

import javax.faces.context.FacesContext;
import valueObject.UserVO;

/**
 *
 * @author David
 */
public class indexMB {

    /**
     * Creates a new instance of indexMB
     */
    public indexMB() {
    }
    
    
    public String redirect() {
         UserVO userVo = (UserVO) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("user");
         switch(userVo.getRole().getId()) {
             case 1: return "admin";
             case 2: return "university";
             case 3: return "professor";
             default: return "index";
         }
    }
}
